Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MakeFieldReadonly false positive for ref assignments #58459

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

mavasani
Copy link
Contributor

Fixes #46785
Fixes #57983

@mavasani mavasani added this to the 17.1 milestone Dec 22, 2021
@mavasani mavasani requested review from sharwell and a team December 22, 2021 06:25
@mavasani mavasani merged commit bf84ccf into dotnet:main Dec 22, 2021
@ghost ghost modified the milestones: 17.1, Next Dec 22, 2021
@mavasani mavasani deleted the IDE0044_FP branch December 22, 2021 08:27
simpleAssignmentOperation.Value == operation &&
simpleAssignmentOperation.IsRef)
{
return ValueUsageInfo.ReadableWritableReference;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you have: readonly ref int x = ref y does this count as a read/write ref now? or just a read-ref? It should be the latter. Can you check, fix if necessary, and add test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➡️ Filed #58466 to resolve this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agreed. This case should be readable reference, I'll make the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants